<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>ES6 的继承除了写法以外还有什么区别</title>
</head>

<body>
  <script>
    //ES6继承
    class PersonModel {}

    class Person extends PersonModel {}
    console.log("ES6的子类可以通过__proto__找到父类", Person.__proto__ === PersonModel);

    //ES5继承
    function CatModel() {}

    function Cat() {}
    Cat.prototype = new CatModel();
    console.log("ES5的子类通过__proto__找到的是Function的原型对象", Cat.__proto__ === Function.prototype);;
  </script>
</body>

</html>